<script setup lang="ts">
import type { HotItem } from '@/types/home.d.ts'
const props = defineProps<{
  list: HotItem[]
}>()
console.log(props)
</script>

<template>
  <view class="panel hot">
    <view class="item" v-for="item in list" :key="item">
      <view class="title">
        <text class="title-text">{{ item.title }}</text>
        <text class="title-desc">{{ item.alt }}</text>
      </view>
      <view class="imgs">
        <image
          v-for="(i, d) in item.pictures"
          :key="d"
          class="image"
          mode="aspectFill"
          :src="i"
        ></image>
      </view>
    </view>
  </view>
</template>

<style lang="scss" scoped>
.panel {
  display: flex;
  // padding: 10rpx 0;
  margin: 20rpx 20rpx 0;
  flex-wrap: wrap;
  border-radius: 10rpx;
  background-color: rgb(250, 127, 146, 0.1);
  .item {
    width: 50%;
    padding: 15rpx;
    border-right: 1rpx solid #fff;
    border-top: 1rpx solid #fff;
    &:nth-child(2n) {
      border-right: 0 none;
    }
  }
  .title {
    font-size: 32rpx;
    color: #262626;
    .title-text {
      margin-right: 20rpx;
    }
    .title-desc {
      font-size: 24rpx;
      color: #666;
    }
  }
  .imgs {
    display: flex;
    justify-content: space-between;
    margin-top: 10rpx;
  }
  .image {
    width: 150rpx;
    height: 150rpx;
    border-radius: 10rpx;
  }
}
</style>
